package main

import (
	"net/http"
	"fmt"
	"strings"
	"net/url"
	"github.com/gpmgo/gopm/modules/log"
)
func IsError(error interface{}) bool {

	if error != nil {
		log.Debug("errorMessage")
		panic(error)
		return false
	}
	return true
	
}


func main() {

	getResponse, getError := http.Get("https://www.baidu.com")

	IsError(getError)

	//http的content-type
	postResponse, postError:= http.Post("https://www.baidu.com","application/x-www-form-urlencoded",strings.NewReader("name=wgc"))

	IsError(postError)

	postFromtResponse, postFromError:= http.PostForm("https://www.baidu.com", url.Values{"name":{"wgc"}})

	IsError(postFromError)

	defer postResponse.Body.Close()

	defer getResponse.Body.Close()

	defer postFromtResponse.Body.Close()


	str := strings.ToTitle("wohis")

	fmt.Printf("str %v", str)
}